package com.example.entity;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 消费记录实体类
 */
@Data
public class ConsumptionRecord {
    
    /**
     * 主键ID
     */
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 店长ID
     */
    private Long storeManagerId;
    
    /**
     * 预约ID
     */
    private Long appointmentId;
    
    /**
     * 套餐ID
     */
    private Long packageId;
    
    /**
     * 套餐名称
     */
    private String packageName;
    
    /**
     * 消费金额
     */
    private BigDecimal consumeAmount;
    
    /**
     * 支付方式：BALANCE-余额支付，ALIPAY-支付宝，WECHAT-微信支付
     */
    private String paymentMethod;
    
    /**
     * 订单号
     */
    private String orderNo;
    
    /**
     * 交易状态：0-失败，1-成功，2-处理中
     */
    private Integer status;
    
    /**
     * 备注
     */
    private String remark;
    
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
    
    /**
     * 删除标记：0-未删除，1-已删除
     */
    private Integer deleted;
    
    // 便捷方法
    public boolean isSuccess() {
        return this.status != null && this.status == 1;
    }
    
    public boolean isFailed() {
        return this.status != null && this.status == 0;
    }
    
    public boolean isProcessing() {
        return this.status != null && this.status == 2;
    }
    
    public void setSuccess() {
        this.status = 1;
    }
    
    public void setFailed() {
        this.status = 0;
    }
    
    public void setProcessing() {
        this.status = 2;
    }
} 